import com.mapper.UsersMapper;
import com.pojo.Users;
import com.utils.MyBatisUtils;
import org.apache.ibatis.session.SqlSession;
import org.junit.Test;

public class UsersTest {
    @Test
    public void findUserTest(){
        SqlSession session = MyBatisUtils.getSession();
        Users users = session.
                selectOne("com.mapper.UsersMapper.findUserWithOrders", 1);
        System.out.println(users);
        session.close();
    }

    @Test
    public void selectUserByIdTest(){
        SqlSession session = MyBatisUtils.getSession();
        UsersMapper mapper = session.getMapper(UsersMapper.class);
        Users user = mapper.selectUserById(1);
        System.out.println(user);
        session.close();
    }
}
